package L01;
//线程等待

public class T10 {
    public static void main (String[] args) {
        Thread t=new Thread (()->{
            for (int i = 0; i < 5; i++) {
                System.out.println ("t 线程正在工作 ");
                try {
                    Thread.sleep (1000);
                } catch (InterruptedException e) {
                    throw new RuntimeException (e);
                }
            }
        });

        System.out.println ("开始等待");
        try {
            t.join ();
        } catch (InterruptedException e) {
            throw new RuntimeException (e);
        }
        System.out.println ("等待结束");

    }

}
